<%@ page language="java" import="java.util.*,java.lang.*" pageEncoding="utf-8" isErrorPage="true"%>
<html>
	<head>
	<script type="text/javascript">
		function Mycheck(){
			alert("请！！");
			if(form1.text1.value=" "){
				alert("请输入表单的内容！！！");
				form1.text1.focus();
				return;
			}
			form1.submit();
		}
	</script>
	<script type="text/javascript">
		function Mycheck1(){
			alert("2");
			if(form2.text2.value=" "){
				alert("请输入表单的内容！！！");
				form2.text2.focus();
				return;
			
			}
			form2.submit();
		}
	</script>
	<script type="text/javascript">
		function Mycheck2(){
			alert("3");
			if(form3.text3.value=" "){
				alert("请输入表单的内容！！");
				form3.text3.focus();
				return;
			}
			form3.submit();
		}
	</script>
	</head>
	<body>
		<h1>这是一个错误页面</h1>
		<%String[] book={"javaweb编程","java思想","java重入门到精通","java历史","java程序员"}; %>
		
		<table>
		<%for(int i=0;i<=book.length-1;i++){ %>
			<tr>
			
				<td><%=i%></td>
				<td><%=book[i] %></td>
			
			</tr>
		<%} %>
		</table>
		
					<select>
						<%for(int i=0;i<=book.length-1;i++){ %>
						<option value=<%=book[i] %>><%=book[i] %></option>
						<%} %>
					</select>
		<%
			String text1="";
			String text2="";
			String text3="";
			String message="";
			if(request.getParameter("text1")!=null){
				text1=request.getParameter("text1");
				message="提交了第一个表单，提交内容为"+text1+"";
			}
			if(request.getParameter("text2")!=null){
				text1=request.getParameter("text2");
				message="提交了第二个表单，提交内容为"+text2+"";
			}
			if(request.getParameter("text3")!=null){
				text1=request.getParameter("text3");
				message="提交了第三个表单，提交内容为"+text3+"";
			}
		 %>
		<form name="form1" method="post" action="error.jsp?formid=1">
			<input name="text1" type="text" class="text" value="<%=text1%>"/>
			<input name="submit1" type="button" onclick="Mycheck();" value="提交"/>
		</form>
		<form name="form2" method="post" action="?formid=2">
			<input name="text2" type="text" class="text" value="<%=text2%>"/>
			<input name="submit2" type="button" onclick="Mycheck1();" value="提交"/>
		</form>
		<form name="form3" method="post" action="?formid=3">
			<input name="text3" type="text" class="text" value="<%=text3%>"/>
			<input name="submit3" type="button" onclick="Mycheck2();" value="提交"/>
		</form>
			<%=message %>
	</body>
</html>